home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Graphics Samples / viewPort Mania ƒ / viewPort Mania.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-11  |  17.8 KB  |  519 lines  |  [TEXT/KAHL]

  1. /**\
  2. |**| =====================================================================
  3. |**|
  4. |**|    viewPort Mania.c
  5. |**|
  6. |**|    gxViewPort Mania creates a window and attaches 6 childViewPorts to
  7. |**|    the parent gxViewPort of the window. We create a textShape and attach
  8. |**|    this gxShape to all of the childViewPorts.  This will allow the
  9. |**|    textShape to be drawn into all 6 childViewPorts simultaneously.
  10. |**|    Each of the childViewPorts has different attributes applied, which
  11. |**|    causes the textShape to be drawn in a slightly different manner in
  12. |**|    each of the childViewPorts.  
  13. |**|    
  14. |**|    The following list describes the settings of each of the childViewPorts:
  15. |**|    
  16. |**|    childViewPort 1:     textShape will be drawn in it's native geometry.
  17. |**|    childViewPort 2:     textShape will be scaled by 200% before it is drawn.
  18. |**|    childViewPort 3:     textShape will be scaled by 200% and the gxGrayPort
  19. |**|                        attribute will be applied to the childViewPort before
  20. |**|                        the textShape is drawn
  21. |**|    childViewPort 4:     textShape will be scaled by 300% in the x direction
  22. |**|    childViewPort 5:     textShape will be scaled by 300% in the y direction
  23. |**|    childViewPort 6:     textShape will be drawn through an Round Dot gxHalftone
  24. |**|    
  25. |**|    All of the previous effects for each childViewPort will be setup
  26. |**|    in the AdjustChildViewPortInfo function.
  27. |**|        
  28. |**|
  29. |**|    QuickDraw GX Libraries Used:
  30. |**|    "color library.c", "font library.c", "graphics debug library.c",
  31. |**|    "shape library.c", and "transform library.c".
  32. |**|
  33. |**|    Change History:
  34. |**|        3/90    ???        New
  35. |**|        4/96    cnn        Changed fixed to Fixed.
  36. |**|
  37. |**|    ©1990-1996  Apple Computer, Inc.
  38. |**|    All rights reserved.
  39. |**|
  40. |**| =====================================================================
  41. \**/
  42.  
  43.  
  44. #include "graphics shell.h"
  45.  
  46.  
  47.  
  48. /**\
  49. |**| ---------------------------------------------------------------------
  50. |**| ENUMS
  51. |**| ---------------------------------------------------------------------
  52. \**/
  53. enum {    kNumberOfChildViewPorts                         = 6,
  54.         kNumberOfTextShapesToBeDrawn                 = 17,
  55.  
  56.         kSpacingBetweenChildViewPorts                 = 25,
  57.         kSpacingForTextInfoBetweenChildViewPorts     = 15,
  58.         kWidthOfAChildViewPort                         = 150,
  59.  
  60.         kTextShapeTextSize                             = 36,
  61.         kTextShapeStartingHLocation                     = 24,
  62.         kTextShapeStartingVLocation                     = 92  };
  63.  
  64.  
  65. /**\
  66. |**| ---------------------------------------------------------------------
  67. |**| GLOBALS
  68. |**| ---------------------------------------------------------------------
  69. \**/
  70. // If gDebugging = TRUE, graphics library errors and notices will be posted.  This
  71. // functionality will only work with the "debugging" version of QuickDraw GX.
  72. // If the debugging version is not installed, nothing bad will happen, but these
  73. // functions will not work. 
  74.  
  75. Boolean        gDebugging = true;
  76.  
  77. // Set  "gGiveMeValidation" to TRUE if you want receive run-time validation.
  78.  
  79. Boolean        gGiveMeValidation = true;
  80.  
  81.  
  82. // gGraphicsHeapSize sets the size of the graphics heap created by calling the
  83. // GXNewGraphicsClient routine in main () within QuickDraw GX shell.c.  You can determine
  84. // the amount of graphics heap required by using GraphicsBug.
  85.  
  86. long        gGraphicsHeapSize = 75;
  87.  
  88.  
  89.  
  90. gxShape     gTextShape;
  91. gxColor     gTextColor;
  92.  
  93. //
  94. //      Contains the list of all created viewPorts.  You need this list to enable the application to attach 
  95. //    the gTextShape to all of the child viewPorts attached to the window.
  96. //
  97. gxViewPort     gChildViewPortList[kNumberOfChildViewPorts]; 
  98. short        gTotalNumberOfTextShapesDrawn,
  99.             gDegreesOfRotation;
  100. Fixed        x,y;
  101.  
  102.  
  103.  
  104. /**\
  105. |**| ---------------------------------------------------------------------
  106. |**| PROTOTYPES
  107. |**| ---------------------------------------------------------------------
  108. \**/
  109.  
  110. // funtions required by shell
  111.  
  112. void    DoInitialization        (WindowPtr wind);
  113. void    DoDraw                    (WindowPtr wind);
  114. void    DoDispose                (WindowPtr wind);
  115. void    DoClick                    (gxPoint orgMouseLoc, WindowPtr theWindow );
  116. void    DoIdle                    (WindowPtr wind);
  117.  
  118. // private functions
  119.  
  120. void    AdjustChildViewPortInfo    (gxViewPort temporaryChildViewPort, short childViewPortCounter);
  121. void     DrawInfo                (void);
  122.  
  123.  
  124.  
  125. /*------ AdjustChildViewPortInfo ------------------------------------------------------------------------*/
  126.  
  127. void    AdjustChildViewPortInfo (gxViewPort temporaryChildViewPort, short childViewPortCounter)
  128. {
  129.     gxMapping        childViewPortMapping;
  130.     gxShape            childViewPortFrame;
  131.     gxRectangle     childViewPortFrameBounds;
  132.     Fixed            x,y;    
  133.     gxHalftone        theHalfTone;    
  134.  
  135.     //  NOTE: the childViewPortCounter is 0 based  
  136.     
  137.     switch (childViewPortCounter){
  138.     
  139.     //
  140.     //  childViewPort #2 : get the gxMapping of the childViewPort, and scale it by 200% 
  141.     //
  142.         case 1:    
  143.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  144.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  145.                 
  146.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  147.  
  148.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  149.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  150.                 ScaleMapping(&childViewPortMapping, ff(2), ff(2), x, y);
  151.  
  152.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  153.         
  154.                 GXDisposeShape(childViewPortFrame);    
  155.                 break;
  156.  
  157.  
  158.     //
  159.     //  childViewPort #3 : set the childViewPort with a dither level of 4 and set the gxGrayPort attribute. 
  160.     //                     get the gxMapping of the childViewPort, and scale it by 200% 
  161.     //
  162.         case 2:    
  163.                 GXSetViewPortAttributes(temporaryChildViewPort, gxGrayPort);
  164.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  165.             
  166.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  167.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  168.                 
  169.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  170.  
  171.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  172.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  173.                 ScaleMapping(&childViewPortMapping, ff(2), ff(2), x, y);
  174.  
  175.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  176.         
  177.                 GXDisposeShape(childViewPortFrame);    
  178.                 break;
  179.     
  180.     //
  181.     //  childViewPort #4 : set the childViewPort with a dither level of 4.  get the gxMapping of the childViewPort, 
  182.     //                       and scale it by 300% in the x (vertical) direction. 
  183.     //
  184.         case 3:    
  185.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  186.                     
  187.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  188.             
  189.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  190.                 
  191.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  192.  
  193.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  194.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  195.                 ScaleMapping(&childViewPortMapping, ff(1), ff(3), x, y);
  196.  
  197.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  198.         
  199.                 GXDisposeShape(childViewPortFrame);    
  200.                 break;
  201.  
  202.     //
  203.     //  childViewPort #5 : set the childViewPort with a dither level of 4.  get the gxMapping of the childViewPort, 
  204.     //                       and scale it by 300% in the y (horizontal) direction. 
  205.     //
  206.         case 4:    
  207.                 GXSetViewPortDither (temporaryChildViewPort, 4);
  208.                 GXGetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  209.             
  210.                 childViewPortFrame = GXGetViewPortClip(temporaryChildViewPort);
  211.                 
  212.                 GXGetShapeBounds(childViewPortFrame, 0L, &childViewPortFrameBounds);
  213.  
  214.                 x = childViewPortFrameBounds.left + childViewPortFrameBounds.right >> 1;
  215.                 y = childViewPortFrameBounds.top + childViewPortFrameBounds.bottom >> 1;
  216.                 ScaleMapping(&childViewPortMapping, ff(3), ff(1), x, y);
  217.  
  218.                 GXSetViewPortMapping(temporaryChildViewPort, &childViewPortMapping);
  219.         
  220.                 GXDisposeShape(childViewPortFrame);    
  221.                 break;
  222.     
  223.     //
  224.     //  childViewPort #6 : set the childViewPort with an gxRoundDot gxHalftone in gxHsvSpace 
  225.     //
  226.         case 5:    
  227.                 theHalfTone.angle         = ff(6);
  228.                 theHalfTone.frequency     = ff(24);
  229.                 theHalfTone.method         = gxRoundDot;
  230.                 theHalfTone.tinting     = gxComponent2Tint;
  231.              
  232.                  theHalfTone.tintSpace                                 = gxCMYKSpace;   
  233.                 theHalfTone.backgroundColor.space                     = gxHSVSpace;
  234.                 theHalfTone.backgroundColor.profile                 = nil;
  235.                 theHalfTone.backgroundColor.element.hsv.value         = 0xFFFF;
  236.                  theHalfTone.backgroundColor.element.hsv.saturation     = 0xCCCD;
  237.                  theHalfTone.backgroundColor.element.hsv.hue         = 0x8000;
  238.     
  239.                 theHalfTone.dotColor.space                             = gxHSVSpace;
  240.                 theHalfTone.dotColor.profile                         = nil;
  241.                 theHalfTone.dotColor.element.hsv.value                 = 0xFFFF;
  242.                 theHalfTone.dotColor.element.hsv.saturation         = 0xAD1C;
  243.                 theHalfTone.dotColor.element.hsv.hue                 = 0xE4F9;
  244.     
  245.                 GXSetViewPortHalftone(temporaryChildViewPort, &theHalfTone);
  246.                 break;
  247.     
  248.         default:    break;
  249.     }
  250. }
  251.  
  252.  
  253.  
  254. /*------ DoInitialization ---------------------------------------------------------------------------------*/
  255.  
  256. void DoInitialization (WindowPtr wind)
  257. {
  258.     gxShape            childViewPortShape;
  259.      gxRectangle     textBoundsShape; 
  260.     gxViewPort        windowViewPortParent, temporaryChildViewPort;
  261.      short            childViewPortCounter;
  262.     Fixed             childViewPortLeftEdge = kSpacingBetweenChildViewPorts, childViewPortTopEdge = kSpacingBetweenChildViewPorts, 
  263.                     childViewPortRightEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts,  
  264.                     childViewPortBottomEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts;
  265.     
  266.     gTotalNumberOfTextShapesDrawn = 0;
  267.     gDegreesOfRotation = 22;
  268.     
  269.     InitCommonColors ();
  270.     
  271.     //
  272.     //     Get the gxViewPort parent for the current window.  We need this gxViewPort ot allow us to attach
  273.     //    all of the childViewPorts to.  
  274.     //
  275.     windowViewPortParent = GXGetWindowViewPort(wind);
  276.  
  277.     //
  278.     //  Create the childViewPort and attach it to the parentViewPort of the current window   
  279.     //
  280.     for (childViewPortCounter = 0;  childViewPortCounter < kNumberOfChildViewPorts; childViewPortCounter++)
  281.       {
  282.           gxRectangle    viewBox;
  283.         
  284.         viewBox.left  = ff(childViewPortLeftEdge);
  285.         viewBox.top = ff(childViewPortTopEdge);
  286.         viewBox.right = ff(childViewPortRightEdge);
  287.         viewBox.bottom = ff(childViewPortBottomEdge);
  288.         
  289.         childViewPortShape = GXNewRectangle(&viewBox);
  290.  
  291.         temporaryChildViewPort =  GXNewViewPort(gxScreenViewDevices);
  292.         
  293.         //
  294.         //  Set the "new" childViewPort to the parentViewPort;  Also, set it's clip gxShape and gxMapping 
  295.         //
  296.         GXSetViewPortParent(temporaryChildViewPort, windowViewPortParent);
  297.         GXSetViewPortClip(temporaryChildViewPort, childViewPortShape);
  298.         GXSetViewPortMapping(temporaryChildViewPort, nil);
  299.  
  300.         //
  301.         //  Change the current childViewPort's attributes for aome excitement(?)
  302.         //
  303.         AdjustChildViewPortInfo (temporaryChildViewPort, childViewPortCounter);  
  304.         
  305.         gChildViewPortList[childViewPortCounter] = temporaryChildViewPort;
  306.     
  307.         childViewPortLeftEdge = childViewPortRightEdge + kSpacingBetweenChildViewPorts;
  308.         childViewPortRightEdge = childViewPortLeftEdge + kWidthOfAChildViewPort;
  309.         
  310.         if (childViewPortCounter == 2) {
  311.             childViewPortLeftEdge = kSpacingBetweenChildViewPorts;
  312.             childViewPortTopEdge = childViewPortBottomEdge + kSpacingBetweenChildViewPorts + kSpacingForTextInfoBetweenChildViewPorts;
  313.             childViewPortRightEdge = kWidthOfAChildViewPort + kSpacingBetweenChildViewPorts;
  314.             childViewPortBottomEdge = childViewPortTopEdge + kWidthOfAChildViewPort;        
  315.         }
  316.     
  317.         GXDisposeShape(childViewPortShape);    
  318.       }
  319.  
  320.  
  321.     //
  322.     //     Set up an HSV gxColor space to run the text through...  
  323.     //
  324.     gTextColor.space                     = gxHSVSpace;
  325.     gTextColor.profile                     = nil;
  326.     gTextColor.element.hsv.hue             = 0xFFFF;
  327.     gTextColor.element.hsv.value         = 0xFFFF;
  328.     gTextColor.element.hsv.saturation     = 0xFFFF;
  329.  
  330.     //
  331.     //  Set the gTextShape's: text string content, the gxFont, and size 
  332.     //
  333.     gTextShape = GXNewText(6,(unsigned char*)"Moof!!",  nil);
  334.     SetShapeCommonFont(gTextShape, timesFont);
  335.     GXSetShapeTextSize(gTextShape, ff(kTextShapeTextSize));
  336.  
  337.     //
  338.     //  Move the gTextShape into the middle of the childViewPort, and attach the gxShape to all of the childViewPorts in the window. 
  339.     //
  340.     GXMoveShapeTo(gTextShape, ff(kTextShapeStartingHLocation),  ff(kTextShapeStartingVLocation));
  341.     GXSetShapeViewPorts(gTextShape, kNumberOfChildViewPorts, gChildViewPortList);
  342.  
  343.     //
  344.     //  Get the bounds of the gTextShape, and the location of the center of  gTextShape. x & y will be used to in the 
  345.     //   GXRotateShape call in the DoDraw functions to make the text rotate around it's center.  
  346.     //
  347.     GXGetShapeBounds(gTextShape, 0L, &textBoundsShape);  
  348.     x = textBoundsShape.left + textBoundsShape.right >> 1;
  349.     y = textBoundsShape.top + textBoundsShape.bottom >> 1;
  350.  
  351.     GXSetShapeAttributes (gTextShape, gxMapTransformShape | GXGetShapeAttributes(gTextShape));
  352. }
  353.  
  354.  
  355.  
  356. /*------ DoDraw ---------------------------------------------------------------------------------------*/
  357.  
  358. void DoDraw (WindowPtr wind)
  359. {
  360.     short        drawViewPortFrameLoop;
  361.     
  362.     if (gTotalNumberOfTextShapesDrawn == 0 || gTotalNumberOfTextShapesDrawn ==  kNumberOfTextShapesToBeDrawn) {
  363.     
  364.         //
  365.         //  Get the frame gxShape from each child gxViewPort, and draw the frame.  
  366.         //
  367.         for (drawViewPortFrameLoop = 0; drawViewPortFrameLoop < kNumberOfChildViewPorts;  drawViewPortFrameLoop++) 
  368.          {
  369.             gxShape    childViewPortFrame;
  370.         
  371.             childViewPortFrame = GXGetViewPortClip(gChildViewPortList [drawViewPortFrameLoop]);
  372.         
  373.             //
  374.             //  Let's erase the contents of the this childViewPort 
  375.             //
  376.             SetShapeCommonColor (childViewPortFrame,gxWhite);
  377.             GXDrawShape (childViewPortFrame);
  378.  
  379.             //
  380.             //  Let's redraw the frame of the current childViewPort.  Set the gxShape's fill to be a frame, set the gxColor,
  381.             //  set the pen thickness, and set the gxStyle attributes to draw the frame on the outside of the childViewPortFrame
  382.             //  gxShape. This prevents the frame from falling a few pixels within the bounds of the childViewPort.                          **/
  383.             //
  384.             GXSetShapeStyleAttributes(childViewPortFrame, gxOutsideFrameStyle);
  385.             GXSetShapeFill (childViewPortFrame,  gxClosedFrameFill); 
  386.             SetShapeCommonColor (childViewPortFrame, gxBlack);
  387.             GXSetShapePen(childViewPortFrame, ff(2)); 
  388.             GXDrawShape (childViewPortFrame);
  389.             GXDisposeShape(childViewPortFrame);    
  390.         }
  391.             
  392.         //
  393.         //     Draw the text information below each childViewPort
  394.         //
  395.         DrawInfo (); 
  396.     }
  397.  
  398.  
  399.     if (gTotalNumberOfTextShapesDrawn ==  kNumberOfTextShapesToBeDrawn) {
  400.         
  401.         //
  402.         //   The text  has been rotated 360 degrees. Let's  reset the gxShape's gxTransform. By resetting the gxTransform 
  403.         //    will reset the gxTransform back to the GX default gxTransform (i.e. no rotate). 
  404.         //
  405.         //    With the call to GXRotateShape below, we have been only effecting the gxShape's gxTransform 
  406.         //    instead of the gxShape's geometry because we had set the gxMapTransformShape attribute above. When we reset
  407.         //    the tranform of our text gxShape, we need to also reset the gxViewPort because the GXResetTransform call
  408.         //    also resets the gxViewPort list.
  409.         //
  410.         GXResetTransform(GXGetShapeTransform(gTextShape));
  411.         GXSetShapeViewPorts(gTextShape, kNumberOfChildViewPorts, gChildViewPortList);
  412.  
  413.  
  414.         gDegreesOfRotation = -gDegreesOfRotation;
  415.         gTotalNumberOfTextShapesDrawn = 0;
  416.     }
  417.     
  418.     GXSetShapeColor(gTextShape, &gTextColor);
  419.     GXDrawShape(gTextShape);
  420.     
  421.     gTextColor.element.hsv.hue -= 0x0600;
  422.  
  423.     GXRotateShape(gTextShape, ff(gDegreesOfRotation), x, y);
  424.         
  425.     gTotalNumberOfTextShapesDrawn++;
  426. }
  427.  
  428.  
  429.  
  430. /*------ DrawInfo --------------------------------------------------------------------------------------*/
  431. //
  432. //    This functions draws the text information below each childViewPort.   
  433. //
  434. void DrawInfo (void)
  435. {
  436.     gxShape        textTitleShape;
  437.     gxPoint        textLocation;
  438.  
  439.     //
  440.     //    We want to reset various attributes of the text as we move our messages around under the various ViewPort.
  441.     //
  442.     GXIgnoreGraphicsNotice(text_size_already_set);
  443.     
  444.     //
  445.     //  Create the textTitleShape, by setting the: Font, size, and starting location...  
  446.     //
  447.     textLocation.x = ff(60);    textLocation.y = ff(190);
  448.     textTitleShape = GXNewText(14, (unsigned char*)"original Shape",  &textLocation);
  449.     SetShapeCommonFont(textTitleShape, timesFont);
  450.     GXSetShapeTextSize(textTitleShape, ff(12));
  451.     GXDrawShape (textTitleShape);
  452.  
  453.     //
  454.     //  Change the textTitleShape for the next message...
  455.     //
  456.     textLocation.x = ff(240);       
  457.     GXSetText(textTitleShape, 12, (unsigned char*)"200% Scaling", &textLocation);
  458.     GXDrawShape (textTitleShape);
  459.  
  460.  
  461.     textLocation.x = ff(365);       
  462.     GXSetText(textTitleShape, 34, (unsigned char*)"200% Scaling with a gray attribute", &textLocation);
  463.     GXDrawShape (textTitleShape);
  464.  
  465.     textLocation.x = ff(17);  textLocation.y = ff(380);
  466.     GXSetText(textTitleShape, 31, (unsigned char*)"300% Scaling in the x direction", &textLocation);
  467.     GXDrawShape (textTitleShape);
  468.  
  469.     textLocation.x = ff(195);     
  470.     GXSetText(textTitleShape, 31, (unsigned char*)"300% Scaling in the y direction", &textLocation);
  471.     GXDrawShape (textTitleShape);
  472.  
  473.     textLocation.x = ff(370);     
  474.     GXSetText(textTitleShape,30, (unsigned char*)"Round Dot Halftone in HSVSpace", &textLocation);
  475.     GXDrawShape (textTitleShape);
  476.  
  477.     GXDisposeShape (textTitleShape);
  478.     
  479.     //
  480.     //    We need to balance all of our GXIgnoreGraphicsNotice calls with GXPopGraphicsNotice calls,
  481.     //    thereby preventing the notice stack from overflowing.'
  482.     //
  483.     GXPopGraphicsNotice(); 
  484. }
  485.  
  486.  
  487.  
  488. /*------ DoDispose -------------------------------------------------------------------------------------*/
  489.  
  490. void DoDispose (WindowPtr wind)
  491. {
  492.     //  
  493.     //    You should always dispose of your GX graphics objects before tossing your window. Why? It's generally good 
  494.     //    form and this approach guarantees that everything is disposed. If you had not disposed of everything, the
  495.     //    call to DisposeWindow should dispose of the objects. If you are running the debugging version of the 
  496.     //    SecretGraphics init with notices set, you will receive a notice that you had not disposed of everything. You
  497.     //    can turn notices on in this file by setting gDebugging = TRUE (above).
  498.     //  
  499.      GXDisposeShape(gTextShape);  
  500.     DisposeCommonColors();  
  501.       DisposeWindow(wind);
  502.  }
  503.     
  504.  
  505.  
  506. /*------ DoClick ---------------------------------------------------------------------------------------*/
  507.  
  508. void DoClick (gxPoint orgMouseLoc, WindowPtr theWindow )
  509. {
  510. }
  511.  
  512.  
  513. /*------ DoIdle ----------------------------------------------------------------------------------------*/
  514.  
  515. void DoIdle (WindowPtr wind)
  516. {
  517.     DoDraw(wind);
  518. }
  519.